<?php
namespace Admin\Model;
use Common\Model\CommonModel;
//绘画作品
class XiaoquModel extends  CommonModel{
	
	//自动验证
	protected $_validate = array(
			//array(验证字段,验证规则,错误提示,验证条件,附加规则,验证时间)
			array('name', 'require', '小区名称不能为空！', 1, 'regex', 3),
			array('are', 'require', '请选择所属片区！', 1, 'regex', 3),

			
	);
	

	public function _after_update() {
		return true;
	}

	public function _after_insert() {
		parent::_after_insert();
		$this->data_cache();
	}
	//删除操作时删除缓存
	public function _after_delete() {
		parent::_after_delete();
		$this->data_cache();
	}



	public function data_cache(){
		


		$list=$this->select();

		foreach($list as  $x){

			$result[$x["are"]][]=$x;


		}

		F("xiaoqu",$result);




	}



	
}